#include <stdio.h>

void printarr(int arr[], int n) {

	for (int i = 0;i<n;i++) {
		printf("%d\t", arr[i]);
	}
}

void arra(int arr[],int n) {
	int key;
	//????????
	for (int i = 1;i < n;i++) {
		key = i;
		for (int k = i - 1;k>=0;k--) {
			if (arr[k]>arr[key]) {
				int mid = arr[k];
				arr[k] = arr[key];
				arr[key] = mid;
				key--;
			}
			else {
				break;
			}
		}
	}
	printarr(arr, n);
	
}


int main() {
	int arr[7] = {12,22,14,35,57,11,9};
	int n = sizeof(arr) / sizeof(arr[0]);
	arra(arr, n);
	return 0;
}

